package main

import (
	"my_go_open/utils"
	"time"
)

func main() {
	ac, _ := utils.NewAmqpClient("amqp://localhost:5672/")
	i := 0
	for {
		time.Sleep(100 * time.Microsecond)
		go func() {
			ch, err := ac.GetChannel()
			if err != nil {
				utils.VarDump(err.Error())
			}
			time.Sleep(200 * time.Microsecond)
			defer ac.PutChannel(ch)
		}()
		i++
		if i == 10 {
			i = 0
			_ = ac.Close()
		}
	}

}
